setTimeout(() => {
  console.log('setTimeout1');
  Promise.resolve().then(() => console.log('promise1'));
});
setTimeout(() => {
  console.log('setTimeout2');
  Promise.resolve().then(() => console.log('promise2'));
});

// Chrome：浏览器控制台中输入以上代码，输出结果为setTimeout1-promise1-setTimeout2-promise2
// Node：终端输入node后再输入以上代码，输出结果为setTimeout1-setTimeout2-promise1-promise2(低版本)